<?php

namespace Database\Seeders;

use App\Models\Domain;
use App\Models\DomainRole;
use App\Models\User;
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;

class DomainRoleSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $domain = Domain::find(1);

        $domain->roles()->create([ 'name' => 'Admin']);
        $domain->roles()->create([ 'name' => 'User']);

        $user = User::find(1);
        $role = DomainRole::find(2);
        $user->domainRoles()->attach($role);
    }
}
